GH-47099: [C++][Parquet] Add missing pragma warning(pop) to parquet/platform.h#47114
GH-47099: [C++][Parquet] Add missing pragma warning(pop) to parquet/platform.h#47114kou merged 8 commits intoapache:mainfrom behrisch:patch-1
pragma warning(pop) to parquet/platform.h#47114Conversation
|
|
|
Could you try to add following code to fix https://ci.appveyor.com/project/ApacheSoftwareFoundation/arrow/builds/52408405 |
I did that but it did not help much AFAICS. How do we continue? Should I add another warning push/pop to exception.h? |
From the above log, |
Yes, that is also my understanding on how the push / pop mechanism works. The warnings are only disabled for everything between the push and the pop. So we either need to
I would prefer option 2 but I have only very limited knowledge about the code base. |
But if you don't add the pop, the warning is disabled for every file which does |
|
As you can see, adding |
Can we use this approach something like the following? diff --git a/cpp/src/parquet/CMakeLists.txt b/cpp/src/parquet/CMakeLists.txt
index dc7d40d2a3..717496496a 100644
--- a/cpp/src/parquet/CMakeLists.txt
+++ b/cpp/src/parquet/CMakeLists.txt
@@ -352,6 +352,18 @@ foreach(LIB_TARGET ${PARQUET_LIBRARIES})
endif()
endforeach()
+# Disable warnings
+foreach(LIB_TARGET ${PARQUET_LIBRARIES})
+ if(MSVC)
+ # Disable warning for STL types usage in DLL interface
+ # https://web.archive.org/web/20130317015847/http://connect.microsoft.com/VisualStudio/feedback/details/696593/vc-10-vs-2010-basic-string-exports
+ target_compile_options(${LIB_TARGET} PUBLIC "/wd4275" "/wd4251")
+ # Disable diamond inheritance warnings
+ target_compile_options(${LIB_TARGET} PRIVATE "/wd4250")
+ ...
+ endif()
+endforeach()
+
if(WIN32 AND ARROW_BUILD_STATIC)
target_compile_definitions(parquet_static PUBLIC PARQUET_STATIC)
endif()We can use |
I don't think so. We just need to add another pair of push/pop to exception.h. I can give this a try if you wish |
|
Sure, feel free to try it out. Thanks! |
|
I did, but the appveyor build failed for different reasons. I am not sure whether simply re-triggering it will already help. |
|
We still see errors in https://github.com/apache/arrow/actions/runs/16593712171/job/46935525834?pr=47114 |
|
OK, I accidentally removed the PARQUET_EXPORT and now tried again |
|
I am not sure about the cancelled ones but all Windows builds seem to be green now |
|
I totally agree, I just tried to adapt to the style of the surrounding code
|
| @@ -57,6 +57,11 @@ | |||
| #include "parquet/thrift_internal.h" // IWYU pragma: keep | |||
| #include "parquet/windows_fixup.h" // for OPTIONAL | |||
|
|
|||
| #ifdef _MSC_VER | |||
There was a problem hiding this comment.
Is it possible to move it into parquet/windows_fixup.h?
There was a problem hiding this comment.
I am not sure whether this is a good idea. parquet/windows_fixup.h is again part of the public facing API (via parquet/schema.h) so we would need to do push / pop again to avoid disabling the warning for everyone.
There was a problem hiding this comment.
I was thinking of defining some common macros for these but it seems that these patterns have already been scattered around. WDYT? @kou
There was a problem hiding this comment.
How about creating parquet/windows_fixup_internal.h?
Our build system doesn't install *_internal.h.
There was a problem hiding this comment.
I am not sure whether it is wort the effort. We are talking about two times three lines of code. Does this need a separate file?
wgtmac
left a comment
There was a problem hiding this comment.
I'm fine to keep the PR as is since there are other pieces of code using the same pattern. Perhaps we can use a separate PR to do the refactoring.
|
Could you rebase on main to fix CI failures? |
|
I did a rebase |
|
Hmm. Could you rebase on https://github.com/apache/arrow/tree/main ? https://github.com/behrisch/arrow/tree/patch-1 shows:
It must not have "... commits behind" after the correct rebase. |
|
Sorry, something went wrong on my side. I hope it is corrected now. @kou |
pragma warning(pop) to parquet/platform.h
|
After merging your PR, Conbench analyzed the 3 benchmarking runs that have been run so far on merge-commit 349d232. There were no benchmark performance regressions. 🎉 The full Conbench report has more details. It also includes information about 2 possible false positives for unstable benchmarks that are known to sometimes produce them. |
…parquet/platform.h` (apache#47114) ### Rationale for this change The missing pragma is causing warnings downstream see apache#47099 ### What changes are included in this PR? * Add the missing `pragma warning(pop)` * Use `pragma warning(disable : 4250)` explicitly in other `.cc`/`.h` * Add missing `PARQUET_EXPORT` ### Are these changes tested? Yes. ### Are there any user-facing changes? The developer should see less warnings otherwise, no. * GitHub Issue: apache#47099 Authored-by: Michael Behrisch <oss@behrisch.de> Signed-off-by: Sutou Kouhei <kou@clear-code.com>
Rationale for this change
The missing pragma is causing warnings downstream see #47099
What changes are included in this PR?
pragma warning(pop)pragma warning(disable : 4250)explicitly in other.cc/.hPARQUET_EXPORTAre these changes tested?
Yes.
Are there any user-facing changes?
The developer should see less warnings otherwise, no.